package com.design.cjm.structural.proxy.example;

/**
 * 送礼代理类
 *
 * @Author: Jie Ming Chen
 * @Date: 2018/9/20
 * @Version 1.0
 */
public class GiveProxy implements GiveGife{

    /**
     * 追求者
     */
    private Pursuer pursuer;

    public GiveProxy(Pursuer pursuer) {
        this.pursuer = pursuer;
    }

    @Override
    public void giveDoll() {

        if (pursuer != null) {
            pursuer.giveDoll();
        }
    }

    @Override
    public void giveFlower() {

        if (pursuer != null) {
            pursuer.giveFlower();
        }
    }

    @Override
    public void giveChocolate() {

        if (pursuer != null) {
            pursuer.giveChocolate();
        }
    }
}
